package test2;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 8888);
        OutputStream os = socket.getOutputStream();

        String message=" hello.服务器,我是客户端";
        os.write(message.getBytes());

        os.close();
        socket.close();
    }
}
